<template>
  <view class="register-outer" :class="responsiveClass" :style="getContainerStyle('md')">
    <view class="register-container">
      <view class="brand-section">
        <view class="logo-container">
          <text class="logo-icon">⚡</text>
        </view>
        <text class="app-name">QuickMind</text>
        <text class="app-slogan">祝你脱离头脑风暴</text>
      </view>
      <view class="register-form">
        <view class="input-group">
          <text class="input-label">用户昵称</text>
          <view class="input-container">
            <text class="input-icon">👤</text>
            <input class="input-field" type="text" placeholder="请输入用户昵称" v-model="form.username" />
          </view>
        </view>
        <view class="input-group">
          <text class="input-label">密码</text>
          <view class="input-container">
            <text class="input-icon">🔒</text>
            <input class="input-field" :type="showPassword ? 'text' : 'password'" placeholder="请输入密码" v-model="form.password" />
            <text class="password-toggle" @click="showPassword = !showPassword">{{ showPassword ? '👁️' : '🙈' }}</text>
          </view>
        </view>
        <view class="input-group">
          <text class="input-label">确认密码</text>
          <view class="input-container">
            <text class="input-icon">🔒</text>
            <input class="input-field" :type="showConfirmPassword ? 'text' : 'password'" placeholder="请再次输入密码" v-model="form.confirmPassword" />
            <text class="password-toggle" @click="showConfirmPassword = !showConfirmPassword">{{ showConfirmPassword ? '👁️' : '🙈' }}</text>
          </view>
        </view>
        <view class="input-group">
          <text class="input-label">电话号码</text>
          <view class="input-container">
            <text class="input-icon">📱</text>
            <input class="input-field" type="text" placeholder="请输入电话号码" v-model="form.phone" />
          </view>
        </view>
        <view class="input-group">
          <text class="input-label">邮箱</text>
          <view class="input-container">
            <text class="input-icon">✉️</text>
            <input class="input-field" type="text" placeholder="请输入邮箱" v-model="form.email" />
          </view>
        </view>
        <button class="register-btn" @click="onRegister">注册</button>
        <view class="register-section">
          <text class="register-text">
            已有账号？
            <text class="register-link" @click="goToLogin">立即登录</text>
          </text>
        </view>
      </view>
    </view>
  </view>
</template>

<script setup>
import { ref } from 'vue'
const form = ref({
  username: '',
  password: '',
  confirmPassword: '',
  phone: '',
  email: ''
})
const showPassword = ref(false)
const showConfirmPassword = ref(false)
function onRegister() {
  // 注册逻辑
}
function goToLogin() {
  uni.navigateTo({ url: '/pages/Login/login' })
}
</script>

<style scoped>
.register-outer {
  height: 100vh;
  width: 100vw;
  background: #f8f9fa;
  display: flex;
  justify-content: center;
  align-items: stretch;
  box-sizing: border-box;
}
.register-container {
  width: 100%;
  max-width: 430px;
  height: 100vh;
  background: #fff;
  border-radius: 32px;
  box-shadow: 0 8px 32px 0 rgba(80,120,200,0.10);
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
}
.brand-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 40px;
  margin-bottom: 32px;
}
.logo-container {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
}
.logo-icon {
  font-size: 38px;
  color: #ff6b35;
}
.app-name {
  font-size: 28px;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 8px;
}
.app-slogan {
  font-size: 16px;
  color: #7f8c8d;
  margin-bottom: 8px;
}
.register-form {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.input-group {
  margin-bottom: 22px;
}
.input-label {
  font-size: 15px;
  color: #2c3e50;
  margin-bottom: 8px;
  display: block;
  font-weight: 500;
}
.input-container {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 16px;
  padding: 0 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1.5px solid #f0f1f5;
  transition: all 0.3s;
}
.input-container:focus-within {
  border-color: #667eea;
  box-shadow: 0 2px 12px rgba(102, 126, 234, 0.15);
}
.input-icon {
  font-size: 20px;
  margin-right: 10px;
  color: #667eea;
}
.input-field {
  flex: 1;
  height: 40px;
  font-size: 15px;
  color: #2c3e50;
  background: transparent;
  border: none;
}
.input-field::placeholder {
  color: #bdc3c7;
}
.password-toggle {
  font-size: 18px;
  color: #95a5a6;
  padding: 8px;
  cursor: pointer;
}
.register-btn {
  width: 100%;
  height: 44px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 600;
  margin-top: 18px;
  margin-bottom: 18px;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.13);
  transition: all 0.2s;
}
.register-btn:active {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}
.register-section {
  text-align: center;
  margin-top: 8px;
}
.register-text {
  font-size: 15px;
  color: #7f8c8d;
}
.register-link {
  color: #667eea;
  font-weight: 600;
  margin-left: 4px;
  cursor: pointer;
}

/* 响应式断点样式 */
/* 平板断点 */
@media (min-width: 481px) {
  .register-container {
    max-width: 480px;
    margin: 0 auto;
  }
  
  .register-form {
    padding: 0 40rpx;
  }
  
  .input-field {
    font-size: 32rpx;
  }
  
  .register-btn {
    height: 88rpx;
    font-size: 36rpx;
  }
}

/* 桌面中等断点 */
@media (min-width: 769px) {
  .register-container {
    max-width: 520px;
    margin: 0 auto;
  }
  
  .register-form {
    padding: 0 60rpx;
  }
  
  .brand-section {
    margin-bottom: 80rpx;
  }
  
  .app-name {
    font-size: 48rpx;
  }
  
  .app-slogan {
    font-size: 32rpx;
  }
  
  .input-group {
    margin-bottom: 44rpx;
  }
}

/* 桌面大屏断点 */
@media (min-width: 1025px) {
  .register-container {
    max-width: 560px;
    margin: 0 auto;
  }
  
  .register-form {
    padding: 0 80rpx;
  }
  
  .input-group {
    margin-bottom: 48rpx;
  }
  
  .register-btn {
    height: 100rpx;
    font-size: 40rpx;
  }
}
</style>
